import Vue from 'vue'
import Router from 'vue-router'
import index from '@/views/index'
import login from '@/views/admin/login'
import home from '@/views/pages/home'
import archive from '@/views/pages/Tag_blog'
import time from '@/views/pages/time'
import about from '@/views/pages/about'
import article from '@/views/pages/article'
import admin_index from '@/views/admin/admin_index'


Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      component: index,
      children: [{
          path: '/',
          name: 'home',
          components: {
            content: home,
          },
          meta: {
            title: 'Su_blog | 一个努力成长中的Java后端程序猿'
          }
        },
        {
          path: 'archive',
          name: 'archive',
          components: {
            content: archive,
          },
          meta: {
            title: 'Su_blog | 一个努力成长中的Java后端程序猿'
          }
        },
        {
          path: 'time',
          name: 'time',
          components: {
            content: time,
          },
          meta: {
            title: 'Su_blog | 一个努力成长中的Java后端程序猿'
          }
        },
        {
          path: 'about',
          name: 'about',
          components: {
            content: about,
          },
          meta: {
            title: 'Su_blog | 一个努力成长中的Java后端程序猿'
          }
        },
        {
          path: 'article',
          name: 'article',
          components: {
            content: article,
          },
          meta: {
            title: 'Su_blog | 一个努力成长中的Java后端程序猿'
          }
        },
      ]
    },

    {
      path: '/',
      redirect: 'home'
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/admin',
      name: 'admin_index',
      component: admin_index,
    },
    {
      path: '/404',
      component: () => import('@/views/404'),
      hidden: true
    },
  ]
})
